<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>while结构——密码</title>
	</head>
	<body>
		<script>
			//while 循环特别适合那些循环次数不固定的情况
			var rightPwd ="fanfan666";
			var inputPwd =prompt("请您输入您的密码：");
			while(rightPwd != inputPwd){
				alert("您的密码有误！");
				inputPwd = prompt("请您输入您的密码：");
			}
			alert("登录成功！");
		</script>
	</body>
</html>
